package org.nf.users.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.nf.db.util.Column;

import java.io.Serializable;


/**
 * @author long
 * @date 2023/6/25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {

    @Column("id")
    private int userID;

    @Column("Username")
    private String Username;

    @Column("Password")
    private String Password;

    @Column("AvatarUrl")
    private String AvatarUrl;

    @Column("Gender")
    private int Gender;

    @Column("Phone")
    private String Phone;

    @Column("isValid")
    private int isValid;

    @Column("account")
    private String account;

    @Column("email")
    private String email;

    @Column("createTime")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private String createTime;

    @Column("updateTime")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private String updateTime;

    @Column("isDelete")
    private int isDelete;

    @Column("role")
    private int role;
}
